﻿@using VirtualPress.Infrastructure.Entities.Enum;
@using VirtualPress.Infrastructure.Entities.Entity;
@{
    Periodical jornalEntity = ViewBag.Journal;
    ViewBag.Title = "期刊链接 -- " + jornalEntity.Name;
    Layout = "/Areas/WorkSpace/Views/Shared/_WorkSpace.cshtml";
}
@section head{
    <link rel="stylesheet" href="/content/css/uniform.css" />
}
<div id="content-header">
    <h1>
        期刊链接</h1>
</div>
<div id="breadcrumb">
    <a href="/WorkSpace/magazine/index" class="tip-bottom"><i class="icon-home"></i>起始页</a> <a href="/WorkSpace/magazine/BaseInfo">
        期刊管理</a> <a href="javascript:" class="current">期刊链接</a>
</div>
<div class="container-fluid">
    <div class="row-fluid">
        <div class="span12">
            <div class="widget-box">
                <div class="widget-title">
                    <h5>
                        期刊链接</h5>
                    <div class="buttons" style="margin-right: 15px;">
                        <a href="/WorkSpace/magazine/AddLinks@{Html.Raw(String.IsNullOrEmpty(Request.QueryString["journal"]) ?"" :"?journal=" + Request.QueryString["journal"]);}" class="btn btn-success btn-mini"><i class="icon-plus icon-white">
                        </i>新增链接</a>
                    </div>
                </div>
                <div class="widget-content nopadding">
                    <table class="table table-bordered">
                        <thead>
                            <tr style="cursor: pointer;">
                                <th style="width: 20%">
                                    链接标题
                                </th>
                                <th style="width: 30%">
                                    链接地址
                                </th>
                                <th style="width: 30%">
                                    备注
                                </th>
                                <th style="width: 10%">
                                    创建时间
                                </th>
                                <th style="width: 10%">
                                    操作
                                </th>
                            </tr>
                        </thead>
                        <tbody>
                            @{ItemListBox<FriendLink> data = ViewBag.Links;
                              List<FriendLink> list = data.Data;}
                            @foreach (var item in list)
                            { 
                                <tr>
                                    <td style="text-align: center">
                                        @item.Title                                    
                                    </td>
                                    <td>
                                        @item.URL
                                    </td>
                                    <td>
                                        @item.Remark
                                    </td>
                                    <td>
                                        @item.CreateTime.ToString("yyyy-MM-dd")
                                    </td>
                                    <td style="text-align: center">
                                        <a href="/WorkSpace/magazine/LinkEdit/@item.Id" class="btn btn-primary btn-mini">编辑</a>
                                        @{
                                string cacncellink = "/WorkSpace/magazine/LinkCancel/" + item.Id;
                                string journal = Request.QueryString["journal"];
                                if (!String.IsNullOrEmpty(journal))
                                {
                                    journal += "?journal=" + journal;
                                }
                                            }
                                        <a href="@cacncellink" class="btn btn-danger btn-mini">删除</a>
                                    </td>
                                </tr>
                            }
                        </tbody>
                    </table>
                </div>
                @Html.Raw(data.PageItemSegment)
            </div>
        </div>
    </div>
</div>
@section tail{
    <script type="text/javascript" src="/scripts/jquery.uniform.js"></script>
    <script type="text/javascript" src="/scripts/select2.min.js"></script>
    <script type="text/javascript" src="/scripts/jquery.dataTables.min.js"></script>
    <script type="text/javascript" src="/scripts/unicorn.tables.js"></script>
    <script type="text/javascript">
        $(function () {
            $('#likjournalmanage').addClass('open active');
        });
    </script>
}
